package com.ruoyi.hospital.service.hospital.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.hospital.HisInfoMapper;
import com.ruoyi.hospital.domain.hospital.HisInfo;
import com.ruoyi.hospital.service.hospital.IHisInfoService;

/**
 * 医院信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-13
 */
@Service
public class HisInfoServiceImpl implements IHisInfoService 
{
    @Autowired
    private HisInfoMapper hisInfoMapper;

    /**
     * 查询医院信息
     * 
     * @param id 医院信息主键
     * @return 医院信息
     */
    @Override
    public HisInfo selectHisInfoById(Integer id)
    {
        return hisInfoMapper.selectHisInfoById(id);
    }

    /**
     * 查询医院信息列表
     * 
     * @param hisInfo 医院信息
     * @return 医院信息
     */
    @Override
    public List<HisInfo> selectHisInfoList(HisInfo hisInfo)
    {
        return hisInfoMapper.selectHisInfoList(hisInfo);
    }

    @Override
    public List<HisInfo> selectHisInfoListLike(String keyWord) {
        return hisInfoMapper.selectHisInfoListLike(keyWord);
    }

    /**
     * 新增医院信息
     * 
     * @param hisInfo 医院信息
     * @return 结果
     */
    @Override
    public int insertHisInfo(HisInfo hisInfo)
    {
        hisInfo.setCreateTime(DateUtils.getNowTimeSecond());
        return hisInfoMapper.insertHisInfo(hisInfo);
    }

    /**
     * 修改医院信息
     * 
     * @param hisInfo 医院信息
     * @return 结果
     */
    @Override
    public int updateHisInfo(HisInfo hisInfo)
    {
        hisInfo.setUpdateTime(DateUtils.getNowTimeSecond());
        return hisInfoMapper.updateHisInfo(hisInfo);
    }

    /**
     * 批量删除医院信息
     * 
     * @param ids 需要删除的医院信息主键
     * @return 结果
     */
    @Override
    public int deleteHisInfoByIds(Integer[] ids)
    {
        return hisInfoMapper.deleteHisInfoByIds(ids);
    }

    /**
     * 删除医院信息信息
     * 
     * @param id 医院信息主键
     * @return 结果
     */
    @Override
    public int deleteHisInfoById(Integer id)
    {
        return hisInfoMapper.deleteHisInfoById(id);
    }
}
